<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.box1 {
				width: 100px;
				height: 100px;
				padding: 20px;
				border: 10px solid #999;
				background: green;
				/*盒子的宽度变大了,需要加上padding和border的宽度*/
				box-sizing:content-box;  /*大家平时所用(默认)*/
			}
			
			.box2 {
				width: 100px;
				height: 100px;
				padding: 20px;
				border: 10px solid #999;
				background: green;
				/*盒子的宽度不会改变,里面能装的东西少了*/
				box-sizing: border-box;
			}
		</style>
	</head>

	<body>
		<div class="box1">
		</div>
		<hr />
		<div class="box2">
		</div>
	</body>

</html>